---
layout: example.html
title: Limited Layer Extent
shortdesc: Restricting layer rendering to a limited extent.
docs: >
  This example uses the <code>layer.setExtent()</code> method to
  modify the extent of the overlay layer.  Use the controls above
  to limit rendering based on an extent (approximate country bounds).
tags: "extent, tilejson"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
  value: Your Mapbox access token from https://mapbox.com/ here
resources:
  - https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css
---
<div id="map" class="map"></div>
<button type="button" class="btn btn-light" id="India">India</button>
<button type="button" class="btn btn-light" id="Argentina">Argentina</button>
<button type="button" class="btn btn-light" id="Nigeria">Nigeria</button>
<button type="button" class="btn btn-light" id="Sweden">Sweden</button>
